home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Getting Started / MPW Development / MPW Additions / INTO Interfaces&Libraries / Cyberdog SDK / PublicIncludes / CyberStream.idl < prev    next >
Encoding:
Text File  |  1996-08-02  |  3.4 KB  |  126 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        CyberStream.idl
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    the cyberdogs
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <3>     6/14/96    emt        Changed property strings to be the same as MIME/HTTP.
  13.          <6>    10/20/95    mc        Synch to OpenDoc 1.0F13e
  14.          <3>     8/18/95    emt        
  15.          <2>      2/8/95    sdh        Implement new CyberStream API
  16.  
  17.     To Do:
  18. */
  19.  
  20. #ifndef _CYBERSTREAM_
  21. #define _CYBERSTREAM_
  22.  
  23. #include "ODObject.idl"
  24. #include "CyberMisc.idl"
  25.  
  26. //==============================================================================
  27. // Classes defined in this interface
  28. //==============================================================================
  29.  
  30. interface  CyberStream;
  31.  
  32.  
  33. //==============================================================================
  34. // Classes used by this interface
  35. //==============================================================================
  36.  
  37. interface  ODStorageUnit;
  38. interface  CyberStream;
  39. interface  CyberSession;
  40.  
  41.  
  42. //==============================================================================
  43. // Definitions for CyberStream
  44. //==============================================================================
  45.  
  46.  
  47. #pragma somemittypes on
  48.  
  49.  
  50. typedef short StreamStatus;
  51. typedef ODISOStr CDStreamProperty;
  52.  
  53. const short kCDDataAvailable                =    1;
  54. const short kCDErrorOccurred                 =    2;
  55. const short kCDStatusStringChanged             =    4;
  56. const short kCDBuffersAreLow                 =    8;
  57. const short kCDDownloadComplete             =    16;
  58. const short kCDAbortComplete                 =    32;
  59.  
  60. const short kCDTotalDataSizeUnknown         =     -1;
  61. const short kCDTotalDataSizeUnknowable         =    -2;
  62.  
  63. const short    kCDLastModTimeUnknown            =    -1;
  64. const short kCDLastModTimeUnknowable        =    -2;
  65.  
  66. const short kCDStreamPropertyUnknown        =     -1;
  67. const short kCDStreamPropertyUnknowable        =    -2;
  68. const short    kCDStreamPropertyAvailable        =    1;
  69.  
  70. const CDStreamProperty kCDTotalDataSizeProperty        =    "Content-Length";        // propertyValue is of type long
  71. const CDStreamProperty kCDLastModTimeProperty        =    "Last-Modified";        // propertyValue is of type ODTime in GMT
  72. const CDStreamProperty kCDLanguageProperty            =    "Content-Language";        // propertyValue is of type char* (null terminated)
  73. const CDStreamProperty kCDCharacterSetProperty        =    "charset";                // propertyValue is of type char* (null terminated)
  74.  
  75. //==============================================================================
  76. // CyberStream
  77. //==============================================================================
  78.  
  79. interface CyberStream : ODObject
  80. {
  81.         StreamStatus    GetStreamStatus();
  82.         long            GetTotalDataSize();
  83.         OSErr            GetStreamError();
  84.         void            GetStatusString(in Str255 message);
  85.         ODTime            GetLastModTime();
  86.         
  87.         ODULong            GetProperty(in CDStreamProperty property, in ODULong length, in ODPtr value);
  88.         ODULong            GetPropertySize(in CDStreamProperty property);
  89.         
  90.         ODBoolean        IsTotalDataSizeAvailable();
  91.         ODBoolean        IsLastModTimeAvailable();
  92.         short            HasProperty(in CDStreamProperty property);
  93.  
  94.         void            Open();
  95.  
  96.         void            GetBuffer(in Ptr* buffer, in Size* bufferSize);
  97.         void            ReleaseBuffer(in Ptr buffer);
  98.  
  99.         void            Abort();
  100.         
  101. #ifdef __SOMIDL__
  102.     implementation
  103.     {
  104.       functionprefix = CyberStream__;
  105.  
  106.     releaseorder:
  107.         GetStreamStatus,
  108.         GetTotalDataSize,
  109.         GetStreamError,
  110.         GetStatusString,
  111.         GetLastModTime,
  112.         IsTotalDataSizeAvailable,
  113.         IsLastModTimeAvailable,
  114.         Open,
  115.         GetBuffer,
  116.         ReleaseBuffer,
  117.         Abort,
  118.         GetProperty,
  119.         GetPropertySize,
  120.         HasProperty;
  121.     };
  122. #endif
  123. };
  124.  
  125. #endif // _CYBERSTREAM_
  126.